package cn.smdq.ch.common.util;

import cn.smdq.ch.common.constant.CommonConstants;
import cn.smdq.ch.common.vo.Result;

/**
 * @author shuimodanqing
 * create at:  2019/1/29  11:31 AM
 * @description 客户端返回结果
 */
public class ResultUtil {

    public static Result ok() {
        return new Result(CommonConstants.SUCCESS_CODE, "ok");
    }

    public static Result ok(Object data) {
        return new Result(CommonConstants.SUCCESS_CODE, "ok", data);
    }

    public static Result error(String msg) {
        return new Result(CommonConstants.ERROR_CODE, msg);
    }

    public static Result error(int code, String msg) {
        return new Result(code, msg);
    }


}
